set(srcs
  AssertException.cpp
  Test.cpp
  Checks.cpp
  TestRunner.cpp
  TestResults.cpp
  TestReporter.cpp
  TestReporterStdout.cpp
  ReportAssert.cpp
  TestList.cpp
  TimeConstraint.cpp
  MemoryOutStream.cpp
)

if(WIN32)
  set(srcs_platform
    Win32/TimeHelpers.cpp
  )
else(WIN32)
  if(UNIX)
    set(srcs_platform
      Posix/SignalTranslator.cpp
      Posix/TimeHelpers.cpp
    )
  endif(UNIX)
endif(WIN32)

set(test_srcs
  tests/Main.cpp
  tests/TestAssertHandler.cpp
  tests/TestChecks.cpp
  tests/TestUnitTestCpp.cpp
  tests/TestTest.cpp
  tests/TestTestResults.cpp
  tests/TestTestRunner.cpp
  tests/TestCheckMacros.cpp
  tests/TestTestList.cpp
  tests/TestTestMacros.cpp
  tests/TestTimeConstraint.cpp
  tests/TestMemoryOutStream.cpp
)

set(test_libs
  unittest++
)

add_library(unittest++ STATIC ${srcs} ${srcs_platform})

add_executable(testunittest++ ${test_srcs})

target_link_libraries(testunittest++ ${test_libs})
